<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
>
<head>
  <title>Spring Security Example </title>
</head>
<body>
<div th:if="${param.error}">
  Invalid username and password.
</div>
<div th:if="${param.logout}">
  You have been logged out.
</div>
<form th:action="@{/login}" method="post">
  <div><label> User Name : <input type="text" name="username"/> </label></div>
  <div><label> Password: <input type="password" name="password"/> </label></div>
  <div>
    <input type="text" class="form-control" name="verifyCode" required="required" placeholder="验证码">
    <img src="getVerifyCode" title="看不清，请点我" onclick="refresh(this)" onmouseover="mouseover(this)"/>
  </div>
  <div>
    <label><input type="checkbox" name="remember-me"/>自动登录</label>
    <button type="submit">立即登陆</button>
  </div>
</form>
<script>
  function refresh(obj) {
    obj.src = "getVerifyCode?" + Math.random();
  }

  function mouseover(obj) {
    obj.style.cursor = "pointer";
  }
</script>
</body>
</html>